import request from '@/config/request'

//登录接口
export const login = (data) => {
  return request.post('/user/login', data)
}
// 注册接口
export const register = (data) => {
  return request.post('/user/register', data)
}

// 修改密码接口
export const changePassword = (data) => {
  return request.post('/user/changePassword', data)
}


// 添加卡片
export const addCard = (data) => {
  return request.post('/user/addCard', data)
}

// 获取所有卡片
export const getCardList = (id) => {
  return request.get(`/user/getCardList/${id}`)
}


// 新增账单
export const addBill = (data) => {
  return request.post("/user/addBill",data)
}

// 时间筛选
export const getBillList = (data) =>{
  return request.post("/user/getBillList",data)
}

// 全部筛选
export const getAllBillList = (id) =>{
  return request.post(`/user/getAllBillList/${id}`)
}

export const updateBill = (data) =>{
  return request.put("/user/updateBill",data)
}

export const delBill = (id) =>{
  return request.delete(`/user/delBill/${id}`)
}